const mongoose = require("mongoose");
const Db = require("../index")
// 结构约束规则
const schema = new mongoose.Schema({
	advTitle: {
		type: String,
		required: true,
		unique: true
	},
	// 广告链接
	advHref: {
		type: String,
		required: true
	},
	// 广告类型
	advType: {
		type: Number,
		required: true
	},
	// 广告图片
	advPic: {
		type: String,
		required: true
	},
	// 广告排序
	advOrder: {
		type: Number,
		required: true
	},
	addTime: {
		type: String,
		required: true
	},
	upTime: {
		type: String,
		required: true
	},
}, {
	versionKey: false
})
// model
const model = mongoose.model("advList", schema, "advList");
module.exports = new Db(model);